// see convert_rating.js for documentation
// removes the rating image used on cd reviews

// should only be called if rating custom field exists

$(function() {
	
	$('#content img').each(function() { 
	    var url_str = $(this).attr('src');
	    var filename_str = url_str.replace(/^.*\//, '');
	    	 
	    var fresh = filename_str.search(/tasty/i);   
	    var fresh = filename_str.search(/fresh/i);
	    var edible = filename_str.search(/edible/i);
	    var stale = filename_str.search(/stale/i);
	    var moldy = filename_str.search(/moldy/i);
	    
	    // search() returns -1 for not found. when it finds a match, it returns the
	    // starting place in the string (ex: "test one test".search('one') would return 5)
	    if (Math.max(tasty, fresh, edible, stale, moldy) > -1) {
	    	$(this).remove();
	    }
	});
});